<template>
  <el-container class="main-container">
    <el-header class="main-header" height="70px">
      <div class="header">
        <img src="../../assets/logo.png" />
        <span>扶贫助农管理系统</span>
      </div>
      <el-button type="warn" @click="$router.push('/frontmain')">前台</el-button>
    </el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu
          :router="true"
          background-color="#f1f1f1"
          text-color="#000"
          default-active="/"
          unique-opened
        >
          <el-menu-item index="/main/tongji" :class="{activeColor:$route.path=='/main/tongji'}">
            <template slot="title">
              <i class="iconfont icon-shouye"></i>
              <span>首页</span>
            </template>
          </el-menu-item>
          <!-- 用户管理 -->
          <el-menu-item index="/main/yonghu" :class="{activeColor:$route.path=='/main/yonghu'}">
            <i class="iconfont icon-yonghu"></i>
            <span>用户管理</span>
          </el-menu-item>

          <!-- 贫困户管理 -->
          <el-menu-item index="/main/pinkunhu" :class="{activeColor:$route.path=='/main/pinkunhu'}">
            <i class="iconfont icon-pinkunhu"></i>
            <span>贫困户管理</span>
          </el-menu-item>
          <!-- 扶贫管理 -->
          <el-menu-item index="/main/fupin" :class="{activeColor:$route.path=='/main/fupin'}">
            <i class="iconfont icon-fuping"></i>
            <span>扶贫政策管理</span>
          </el-menu-item>

          <!-- 志愿者管理 -->
          <el-menu-item index="/main/zhiyuanze" :class="{activeColor:$route.path=='/main/zhiyuanze'}">
            <i class="iconfont icon-zhiyuanzhe"></i>
            <span>志愿者管理</span>
          </el-menu-item>

          <!-- 留言管理 -->
          <el-menu-item index="/main/liuyanban" :class="{activeColor:$route.path=='/main/liuyanban'}">
            <i class="iconfont icon-liuyan"></i>
            <span>留言管理</span>
          </el-menu-item>
          <!-- 收藏管理 -->
          <!-- <el-menu-item index="/main/shoucang">
            <i class="iconfont icon-shoucang"></i>
            <span>收藏管理</span>
          </el-menu-item> -->
          <!-- 轮播图管理 -->
          <el-menu-item index="/main/lunbotu" :class="{activeColor:$route.path=='/main/lunbotu'}">
            <i class="iconfont icon-lunbotuguanli"></i>
            <span>轮播图管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<style lang="less" scoped>
.el-container {
  height: 100%;
}

.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #253b6e;
  div {
    width: 300px;
    display: flex;
    align-items: center;
    color: white;
    justify-content: space-around;
    
    span {
      font-size: 22px;
      font-weight: 700;
    }
    img {
      width: 60px;
      height: 50px;
      border-radius: 50%;
    }
  }
}
.el-aside {
  height: 100%;
  background-color: #f1f1f1;
  overflow: hidden;
}
.el-menu{
  padding-top: 3px;
}
.el-menu-item{
  i{
    font-size: 20px;
    margin-right: 5px;
  }
}
.activeColor{
  background-color: #253b6e !important;
  color: #fff !important;
}
.el-main {
  height: 100%;
  .bodyBox{
    height: 100%;
  }
}
</style>